<include file="Public:header" />
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <!-- Panel Other -->
    <div class="ibox float-e-margins">
        <div class="ibox-title"  class="col-md-6">
            <h5>买单列表</h5>
        </div>
        <div class="ibox-content">
            <!--搜索框结束-->
            <div class="hr-line-dashed"></div>
				<div class="example-wrap">
					<div class="example">
						<div class="bootstrap-table">
							<div class="fixed-table-container" style="height: 641px; padding-bottom: 36px;">
								<div class="fixed-table-header" style="margin-right: 0px;"></div>
								<div class="fixed-table-body">
									<table id="cusTable" data-height="" class="table table-hover table-striped">
										<tbody>
											<tr class="list_row2">
												<td class="details" style="padding-left:10px;">当前价格</td>
												<td class="details" style="padding-left:10px;">
													【价格】：{$now_price['price']}
													【可交易数量】：{$now_price['num']}
													【挂单数量】：{$now_price['sell_num']}
													【总数】：{$now_price['all_num']}
												</td>
											</tr>
											<tr><td colspan="13">{$list['page']}</td>
											</tr>
										</tbody>
									</table>
									<div class="ibox-content" style="border:solid 1px black;">
										<form class="form-horizontal m-t" id="price_form" method="post" >
											<h3>价格调整</h3>
											<div class="form-group">
												<label class="col-sm-3 control-label">价格:</label>
												<div class="input-group col-sm-4">
													<input id="shopName" type="text" value="{$now_price['price']}" class="form-control" name="price" required="" aria-required="true">
												</div>
											</div>
											<div class="form-group">
												<div class="col-sm-4 col-sm-offset-3">
													<button class="btn btn-primary" type="button" onclick="change()">提交</button>
												</div>
											</div>
										</form>
									</div><br>
									<div class="ibox-content" style="border:solid 1px black;">
										<form class="form-horizontal m-t" id="form" method="post" >
											<h3>股权拆分</h3>
											<div class="form-group">
												<label class="col-sm-3 control-label">拆分金额:</label>
												<div class="input-group col-sm-4">
													<input id="shopName" type="text" value="{$now_price['price']}" class="form-control" name="price" required="" aria-required="true">
												</div>
											</div>
											<div class="form-group">
												<div class="col-sm-4 col-sm-offset-3">
													<button class="btn btn-primary" type="button" onclick="split()">拆分</button>
												</div>
											</div>
										</form>
									</div>
								</div>
								<div class="pull-right pagination"></div>
							</div>
						</div>
						<div class="clearfix"></div>
					</div>
				</div>
            <!-- End Example Pagination -->
        </div>
    </div>
</div>
<!-- End Panel Other -->
</div>
<include file="Public:footer" />
<script type="text/javascript">
				function change(){
				layer.confirm('是否调整股票价格？', {
					btn: ['确认','取消'] //按钮
				}, function(){
					$.ajax({
						 type: "POST",
						 url: "{:U('Price/changePrice')}",
						 data: $("#price_form").serialize(),
						 dataType: "json",
						 error: function(request) {
							layer.closeAll('loading');
							layer.alert("{$Think.lang.系统繁忙请稍后再试}");
						},
						beforeSend: function() {
							var index = layer.load(1, {
							  shade: [0.1,'#fff'] 
							});
						},
						 success: function(data){
								layer.closeAll('loading');
								layer.alert(data['info']);
								if(data['status']==true){
									setTimeout(history.go(0),1000);
								}
							}
					});
				});
			};
				function split(){
				layer.confirm('是否现在拆分？', {
					btn: ['确认','取消'] //按钮
				}, function(){
					$.ajax({
						 type: "POST",
						 url: "{:U('Price/splitPrice')}",
						 data: $("#form").serialize(),
						 dataType: "json",
						 error: function(request) {
							layer.closeAll('loading');
							layer.alert("{$Think.lang.系统繁忙请稍后再试}");
						},
						beforeSend: function() {
							var index = layer.load(1, {
							  shade: [0.1,'#fff'] 
							});
						},
						 success: function(data){
								layer.closeAll('loading');
								layer.alert(data['info']);
								if(data['status']==true){
									setTimeout(history.go(0),1000);
								}
							}
					});
				});
			};
</script>
</body>
</html>